﻿
--Used to set the display order

DECLARE @DocumentTypeId as integer

This sytax error is here to remind you to setup the document types first and to change it for each document type in the marriage group.
--Set up all marriage related document types, then run this script for each type after changing the select statement below.
Select  @DocumentTypeId = [Id] from [DocumentType] where  [Code] = 'MarriageKiosk'

DECLARE @IncrementBy as integer
SET @IncrementBy = 0


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='CeremonyType' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField5' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='ApplyingForMaritalStatusOf' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BloodRelated' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BloodRelatedDescription' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGender' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomPresentMaritalStatus' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField3'  and [DocumentTypeId] = @DocumentTypeId --DateLicenseEffect

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField4' and [DocumentTypeId] = @DocumentTypeId --ExpirationDate

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGender' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField1' and [DocumentTypeId] = @DocumentTypeId --Groom 1st name

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField12' and [DocumentTypeId] = @DocumentTypeId--Groom middle name   

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField13' and [DocumentTypeId] = @DocumentTypeId--Groom last name

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField20' and [DocumentTypeId] = @DocumentTypeId--Groom suffix

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField28' and [DocumentTypeId] = @DocumentTypeId--Groom bith name

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField15' and [DocumentTypeId] = @DocumentTypeId--GroomStreetAddress

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField21' and [DocumentTypeId] = @DocumentTypeId--Groom City

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField16' and [DocumentTypeId] = @DocumentTypeId--Groom state

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField23' and [DocumentTypeId] = @DocumentTypeId -- groom zip

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField24' and [DocumentTypeId] = @DocumentTypeId -- groom country

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField7' and [DocumentTypeId] = @DocumentTypeId -- GroomSSN,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField24' and [DocumentTypeId] = @DocumentTypeId --Groom phone

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField1' and [DocumentTypeId] = @DocumentTypeId -- Groom dob

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField75' and [DocumentTypeId] = @DocumentTypeId --groomBirthCity

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField17' and [DocumentTypeId] = @DocumentTypeId -- GroomBirthStateOrCountry,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomProofOfAge' and [DocumentTypeId] = @DocumentTypeId 

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BitField1' and [DocumentTypeId] = @DocumentTypeId --GroomEverMarried,  

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomPreviousMarriedName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField8' and [DocumentTypeId] = @DocumentTypeId -- GroomNumberofMarriages,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField6' and [DocumentTypeId] = @DocumentTypeId --GroomDatePreviousMarriageEnded,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomDivorcedWidowedDate' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomDivorcedCity' and [DocumentTypeId] = @DocumentTypeId -- GroomLastMarriageEndedBy,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomDivorcedWidowedState' and [DocumentTypeId] = @DocumentTypeId


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomDivorcedWidowedTypeOfCourt' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianRequired' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianFatherFirstName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianFatherMiddleName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianFatherLastName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianFatherCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianFatherState' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianMotherFirstName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianMotherMiddleName' and [DocumentTypeId] = @DocumentTypeId


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianMotherLastName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianMotherCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomGuardianMotherState' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='GroomAllLegalNamesOtherThanBirthOrCurrent' and [DocumentTypeId] = @DocumentTypeId

----------------------------------------------------------------------------------------------------------------

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGender' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BridePresentMaritalStatus' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField18' and [DocumentTypeId] = @DocumentTypeId --BrideFirstName,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField19' and [DocumentTypeId] = @DocumentTypeId --Bride M Name,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField10' and [DocumentTypeId] = @DocumentTypeId --Bride L Name,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField29' and [DocumentTypeId] = @DocumentTypeId --Bride Suffix Name,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField2' and [DocumentTypeId] = @DocumentTypeId--Bride Maiden,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField22' and [DocumentTypeId] = @DocumentTypeId --BrideStreetAddress

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField3' and [DocumentTypeId] = @DocumentTypeId --Bride city

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField5' and [DocumentTypeId] = @DocumentTypeId --Bride state

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField26' and [DocumentTypeId] = @DocumentTypeId -- Bride zip

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField4' and [DocumentTypeId] = @DocumentTypeId -- bride country


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='ComboField3' and [DocumentTypeId] = @DocumentTypeId --bride race


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField9' and [DocumentTypeId] = @DocumentTypeId --BrideSSN

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField27' and [DocumentTypeId] = @DocumentTypeId -- bride phone

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField2' and [DocumentTypeId] = @DocumentTypeId -- bride dob

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideBirthCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField6' and [DocumentTypeId] = @DocumentTypeId -- BrideBirthStateOrCountry

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BitField2' and [DocumentTypeId] = @DocumentTypeId -- BrideEverMarried,

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideProofOfAge' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BridePreviousMarriedName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='TextField11' and [DocumentTypeId] = @DocumentTypeId --BrideNumberofMarriages

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='DateField7' and [DocumentTypeId] = @DocumentTypeId -- BrideDatePreviousMarriageEnded

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideDivorcedWidowedDate' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='ComboField4' and [DocumentTypeId] = @DocumentTypeId --BrideLastMarriageEndedBy,  


SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideDivorcedCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideDivorcedWidowedState' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideDivorcedWidowedTypeOfCourt' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianRequired' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianFatherFirstName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianFatherMiddleName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianFatherCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianFatherState' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianMotherFirstName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianMotherMiddleName' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianMotherCity' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideGuardianMotherState' and [DocumentTypeId] = @DocumentTypeId

SET @IncrementBy = @IncrementBy + 5
update [DocumentTypeField] SET DisplayOrder = @IncrementBy where [FieldName] ='BrideAllLegalNamesOtherThanBirthOrCurrent' and [DocumentTypeId] = @DocumentTypeId

